import java.util.Scanner;
import java.util.Arrays;
public class test {
    public static int add(int k){
        if(k == 1 || k == 2) return 1;

        int arr[] = new int[]{1,2,3,4};
        System.out.println(Arrays.toString(arr));

        return add(k-1) + add(k-2);
    }

    public static void main10(String[] args) {
        // 冒泡排序
        // i表示趟数
        int[] array = new int[]{2,234,51,311,1};
        int n = array.length;
        for(int i = 0;i < n - 1;i++){
            // j表示每次比较的下标
            boolean flag = true;
            // 如果n = 5,第一趟比较4次
            for(int j = 0;j < n - 1 - i;j++){
                if(array[j] < array[j+1]){
                    int tmp = array[j];
                    array[j] = array[j+1];
                    array[j+1] = tmp;
                    flag = false;
                }
            }
            if(flag){
                // flag = true 表示已经有序了
                break;
            }
        }

        for(int i = 0;i < n;i++){
            System.out.println(array[i]);
        }
    }
    public static void main3(String[] args) {
        int ret = add(6);
        System.out.println(ret);
    }

    public static int add1(int a,int b){
        return a + b;
    }

    public static double add1(double a,double b,double c){
        return a + b + c;
    }

    public static void main(String[] args) {
        System.out.println(add1(1,1));
        System.out.println(add1(2.2,1.1,3.3));
    }
    public static double max2(double a,double b,double c){
        double m = -1;
        if(a > m) m = a;
        if(b > m) m = b;
        if(c > m) m = c;

        return m;
    }
    public static int max2(int a,int b){
        if(a > b) return a;
        else return b;
    }

    public static void main11(String[] args) {
        System.out.println(max2(1,2));
        System.out.println(max2(3.3,1.3,3.3));
    }
    public static int max3(int a,int b,int c){
        int k = max2(a,b);
        return max2(k,c);
    }

    public static int func(int k){
        if(k < 10) return k;
        return k % 10 + func(k / 10);
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int ret = func(n);
        System.out.println(ret);
    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
    }
}
